import Vue from 'vue';
import App from './App.vue';
import router from './router';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import vdr from 'vue-draggable-resizable-gorkys';
import 'vue-draggable-resizable-gorkys/dist/VueDraggableResizable.css';
import api from './utils/api.js';
import Toast from 'vue2-toast';
import 'vue2-toast/lib/toast.css';
import jiami from './utils/jiami.js';
import weixin from '@/utils/weixin';
import { Dialog, Popup, RadioGroup, Radio, Icon, Grid, GridItem } from 'vant';
import 'vant/lib/index.css';
import AlloyFinger from 'alloyfinger';
import AlloyFingerPlugin from 'alloyfinger/vue/alloy_finger_vue';
// import Vconsole from 'vconsole';
// let vConsole = new Vconsole();
// Vue.use(vConsole);

Vue.use(AlloyFingerPlugin, { AlloyFinger });

Vue.use(Toast, {
  type: 'center',
  duration: 1500,
  wordWrap: true,
  width: 'auto',
});

Vue.component('vdr', vdr);

Vue.use(ElementUI);

Vue.use(Dialog);
Vue.use(Popup);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Icon);
Vue.use(Grid);
Vue.use(GridItem);

Vue.config.productionTip = false;
Vue.prototype.$api = api;

Vue.prototype.$yy = jiami;
/* eslint-disable no-undef */
weixin.wxConfig(wx, false);

router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
});

new Vue({
  router,
  render: h => h(App),
}).$mount('#app');
